<? session_start();
require_once 'lib/common_function.php';
require_once 'lib/connect.php';

if (isset($_GET['page'])) {
    if(isset($_SESSION['status']) && file_exists("$_SESSION[status]/".$_GET['page'] . '.php')){
        //&& (!isset($_GET['root']) && $_GET['root']!=1)
        include "$_SESSION[status]/$_GET[page].php";
    }else if(file_exists($_GET['page'] . '.php'))
        include "$_GET[page].php";
    else{
        echo "<div class=fb5>ERROR 404 Page Not Found, Pleace Check Your URL. ".base_url()."$_SESSION[status]/".$_GET['page'] . '.php'."</div>";
    }
} else {
    echo "page not found";
}
?>
<script type="text/javascript">
        $(document).ready(function(){
            var a_link=$('a');
            for(var i=0;i<a_link.length;i++){
                $('a:eq('+i+')').attr('href',$('a:eq('+i+')').attr('href')+'&project=<?=$_GET['project']?>');
            }
            var a_link=$('form');
            for(var i=0;i<a_link.length;i++){
                $('form:eq('+i+')').attr('action',$('form:eq('+i+')').attr('action')+'&project=<?=$_GET['project']?>');
            }
        })
    </script>